package com.aaa.sbms.controller;

import com.aaa.sbms.service.TrainVideoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @FileName:TrainVideoController
 * @Description:
 * @Author :99728
 * @Date: 2020/6/22 17:06
 * @Version:1.0.0
 */
@RestController
@RequestMapping("video")
public class TrainVideoController {

    @Autowired
    private TrainVideoService trainVideoService;

    @RequestMapping("page")
    public Object getPage(@RequestParam Map map){
        return trainVideoService.getPage(map);
    }

    @RequestMapping("list")
    public  Object getList(int videoid){
        return trainVideoService.oneList(videoid);
    }

    @RequestMapping("getCourseName")
    public Object getCourseName(@RequestParam Map map){
        return trainVideoService.getCourseName(map);
    }

    @RequestMapping("add")
    public Object add(@RequestBody Map map){
        return trainVideoService.add(map);
    }

    @RequestMapping("delete")
    public Object delete(int videoid){
        return trainVideoService.delete(videoid);
    }

    @RequestMapping("update")
    public Object update(@RequestBody Map map){
        return trainVideoService.update(map);
    }
}
